#ifndef MESH_H
#define MESH_H

#include<vector>
#include <GL/glew.h>
#include <Importer.hpp>
#include <scene.h>
#include <postprocess.h>
/*
struct Vertex
{
  float pos_x, pos_y, pos_z;
  float tex_u, tex_v;
  float nor_x, nor_y, nor_z;

  Vertex(float x,float y,float z,
	 float u,float v,
	 float nx, float ny,float nz)
    :pos_x(x),pos_y(y),pos_z(z),
     tex_u(u),tex_v(v),
     nor_x(nx),nor_y(ny),nor_z(nz){}
};
*/
class Mesh
{
public:
  //  Mesh();

  //  ~Mesh();

  bool LoadMesh(const char* Filename);

  void RenderModel();

private:
  bool InitFromScene(const aiScene* pScene, const char* Filename);
  void InitMeshPNT(unsigned int index, const aiMesh* paiMesh);
  //  bool InitMaterials(const aiScene* pScene, const char* Filename);
  //  void ClearAllTexture();

#define INVALID_MATERIAL 0xFFFFFFFF
#define INVALID_OGL_VALUE 0xFFFFFFFF

  struct MeshEntry
  {
    MeshEntry();
    ~MeshEntry();

    //    void Init(const std::vector<Vertex>& vtx,
    //	      const std::vector<unsigned int>& idx);

    GLuint VtxB;
    GLuint UVmB;
    GLuint NrmB;
    GLuint IdxB;

    unsigned int numIdx;
    //    unsigned int MaterialIndex;
  };

  std::vector<MeshEntry> _entries;
  //  std::vector<Texture*> _Textures;
};

#endif
